﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x020009FC RID: 2556
	internal class XTeamDocument : XDocComponent
	{
		// Token: 0x17002E60 RID: 11872
		// (get) Token: 0x06009C40 RID: 40000 RVA: 0x00192A64 File Offset: 0x00190C64
		public override uint ID
		{
			get
			{
				return XTeamDocument.uuID;
			}
		}

		// Token: 0x17002E61 RID: 11873
		// (get) Token: 0x06009C41 RID: 40001 RVA: 0x00192A7C File Offset: 0x00190C7C
		public List<XTeamBriefData> TeamList
		{
			get
			{
				return this._TeamList;
			}
		}

		// Token: 0x17002E62 RID: 11874
		// (get) Token: 0x06009C42 RID: 40002 RVA: 0x00192A94 File Offset: 0x00190C94
		public XExpeditionDocument ExpDoc
		{
			get
			{
				bool flag = this.m_ExpDoc == null;
				if (flag)
				{
					this.m_ExpDoc = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
				}
				return this.m_ExpDoc;
			}
		}

		// Token: 0x17002E63 RID: 11875
		// (get) Token: 0x06009C43 RID: 40003 RVA: 0x00192ACC File Offset: 0x00190CCC
		public bool bVoting
		{
			get
			{
				return this._bVoting;
			}
		}

		// Token: 0x17002E64 RID: 11876
		// (get) Token: 0x06009C44 RID: 40004 RVA: 0x00192AE4 File Offset: 0x00190CE4
		// (set) Token: 0x06009C45 RID: 40005 RVA: 0x00192AFC File Offset: 0x00190CFC
		public bool bAutoMatching
		{
			get
			{
				return this.m_bAutoMatching;
			}
			set
			{
				this.m_bAutoMatching = value;
			}
		}

		// Token: 0x17002E65 RID: 11877
		// (get) Token: 0x06009C46 RID: 40006 RVA: 0x00192B08 File Offset: 0x00190D08
		public KMatchType SoloMatchType
		{
			get
			{
				return this.m_SoloMatchType;
			}
		}

		// Token: 0x17002E66 RID: 11878
		// (get) Token: 0x06009C47 RID: 40007 RVA: 0x00192B20 File Offset: 0x00190D20
		public bool bSoloMatching
		{
			get
			{
				return this.m_SoloMatchType > KMatchType.KMT_NONE;
			}
		}

		// Token: 0x17002E67 RID: 11879
		// (get) Token: 0x06009C48 RID: 40008 RVA: 0x00192B3C File Offset: 0x00190D3C
		public bool bMatching
		{
			get
			{
				bool bInTeam = this.bInTeam;
				bool result;
				if (bInTeam)
				{
					result = (this._MyTeam.teamBrief.matchType > KMatchType.KMT_NONE);
				}
				else
				{
					result = this.bSoloMatching;
				}
				return result;
			}
		}

		// Token: 0x17002E68 RID: 11880
		// (get) Token: 0x06009C49 RID: 40009 RVA: 0x00192B74 File Offset: 0x00190D74
		// (set) Token: 0x06009C4A RID: 40010 RVA: 0x00192B8C File Offset: 0x00190D8C
		public XTeam MyTeam
		{
			get
			{
				return this._MyTeam;
			}
			set
			{
				this._MyTeam = value;
			}
		}

		// Token: 0x17002E69 RID: 11881
		// (get) Token: 0x06009C4B RID: 40011 RVA: 0x00192B98 File Offset: 0x00190D98
		public bool bInTeam
		{
			get
			{
				return this._MyTeam != null;
			}
		}

		// Token: 0x17002E6A RID: 11882
		// (get) Token: 0x06009C4C RID: 40012 RVA: 0x00192BB4 File Offset: 0x00190DB4
		public bool bIsLeader
		{
			get
			{
				return this._MyTeam != null && this._MyTeam.myData != null && this._MyTeam.myData.bIsLeader;
			}
		}

		// Token: 0x17002E6B RID: 11883
		// (get) Token: 0x06009C4D RID: 40013 RVA: 0x00192BF0 File Offset: 0x00190DF0
		public bool bIsHelper
		{
			get
			{
				return this._MyTeam != null && this._MyTeam.myData != null && this._MyTeam.myData.bIsHelper;
			}
		}

		// Token: 0x17002E6C RID: 11884
		// (get) Token: 0x06009C4E RID: 40014 RVA: 0x00192C2C File Offset: 0x00190E2C
		public bool bIsTecket
		{
			get
			{
				return this._MyTeam != null && this._MyTeam.myData != null && this._MyTeam.myData.bIsTicket;
			}
		}

		// Token: 0x17002E6D RID: 11885
		// (get) Token: 0x06009C4F RID: 40015 RVA: 0x00192C68 File Offset: 0x00190E68
		public int MatchingTime
		{
			get
			{
				return this.m_nMatchingTime;
			}
		}

		// Token: 0x17002E6E RID: 11886
		// (get) Token: 0x06009C50 RID: 40016 RVA: 0x00192C80 File Offset: 0x00190E80
		// (set) Token: 0x06009C51 RID: 40017 RVA: 0x00192C98 File Offset: 0x00190E98
		public TeamBriefSortType TeamListSortType
		{
			get
			{
				return this.m_TeamListSortType;
			}
			set
			{
				bool flag = this.m_TeamListSortType != value;
				if (flag)
				{
					this.m_TeamListSortDirection = XTeamBriefData.DefaultSortDirection[XFastEnumIntEqualityComparer<TeamBriefSortType>.ToInt(value)];
				}
				else
				{
					this.m_TeamListSortDirection = -this.m_TeamListSortDirection;
				}
				this.m_TeamListSortType = value;
			}
		}

		// Token: 0x17002E6F RID: 11887
		// (get) Token: 0x06009C52 RID: 40018 RVA: 0x00192CE0 File Offset: 0x00190EE0
		public int TeamListSortDirection
		{
			get
			{
				return this.m_TeamListSortDirection;
			}
		}

		// Token: 0x06009C53 RID: 40019 RVA: 0x00192CF8 File Offset: 0x00190EF8
		public void SortTeamListAndShow()
		{
			CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
			Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(XSingleton<XGlobalConfig>.singleton.GetValue("Culture"));
			bool bReqTeamListJustTarget = this.m_bReqTeamListJustTarget;
			if (bReqTeamListJustTarget)
			{
				XTeamBriefData.dir = 1;
				XTeamBriefData.sortType = TeamBriefSortType.TBST_MAX;
				this._TeamList.Sort(new Comparison<XTeamBriefData>(XTeamBriefData.CompareToAccordingToRelation));
			}
			else
			{
				XTeamBriefData.dir = this.m_TeamListSortDirection;
				XTeamBriefData.sortType = this.m_TeamListSortType;
				this._TeamList.Sort();
			}
			Thread.CurrentThread.CurrentCulture = currentCulture;
			bool flag = this.TeamListView != null && this.TeamListView.IsVisible();
			if (flag)
			{
				this.TeamListView.RefreshPage();
			}
			bool flag2 = this.AllListView != null && this.AllListView.IsVisible();
			if (flag2)
			{
				this.AllListView.RefreshPage();
			}
		}

		// Token: 0x17002E70 RID: 11888
		// (get) Token: 0x06009C54 RID: 40020 RVA: 0x00192DE0 File Offset: 0x00190FE0
		public HashSet<int> TeamListSelectedCategories
		{
			get
			{
				return this.m_TeamListSelectedCategories;
			}
		}

		// Token: 0x06009C55 RID: 40021 RVA: 0x00192DF8 File Offset: 0x00190FF8
		public static void Execute(OnLoadedCallback callback = null)
		{
			XTeamDocument.AsyncLoader.AddTask("Table/PveProfession", XTeamDocument.m_pveProfessionTables, false);
			XTeamDocument.AsyncLoader.Execute(callback);
		}

		// Token: 0x06009C56 RID: 40022 RVA: 0x00192E20 File Offset: 0x00191020
		public static string GetProfessionKey(uint profession, uint sceneid)
		{
			return XSingleton<XCommon>.singleton.StringCombine(profession.ToString(), "_", sceneid.ToString());
		}

		// Token: 0x06009C57 RID: 40023 RVA: 0x00192E50 File Offset: 0x00191050
		public static void OnTableLoaded()
		{
			XTeamDocument.m_pveProfessions.Clear();
			int i = 0;
			int num = XTeamDocument.m_pveProfessionTables.Table.Length;
			while (i < num)
			{
				XTeamDocument.m_pveProfessions.Add(XTeamDocument.GetProfessionKey((uint)XTeamDocument.m_pveProfessionTables.Table[i].ProfessionID, XTeamDocument.m_pveProfessionTables.Table[i].SceneID), XTeamDocument.m_pveProfessionTables.Table[i]);
				i++;
			}
		}

		// Token: 0x06009C58 RID: 40024 RVA: 0x00192EC4 File Offset: 0x001910C4
		public void SetTarja(uint tarja)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SetTarja:", tarja.ToString(), null, null, null, null);
			this._tarja = tarja;
			bool flag = this.MyTeamView != null && this.MyTeamView.IsVisible();
			if (flag)
			{
				this.MyTeamView.RefreshPage();
			}
			bool flag2 = this.TeamListView != null && this.TeamListView.IsVisible();
			if (flag2)
			{
				this.TeamListView.RefreshPage();
			}
			bool flag3 = this.AllListView != null && this.AllListView.IsVisible();
			if (flag3)
			{
				this.AllListView.RefreshPage();
			}
			bool flag4 = this.DungeonSelector != null && this.DungeonSelector.IsVisible();
			if (flag4)
			{
				this.DungeonSelector.RefreshData();
			}
		}

		// Token: 0x17002E71 RID: 11889
		// (get) Token: 0x06009C59 RID: 40025 RVA: 0x00192F8C File Offset: 0x0019118C
		public bool IsTarja
		{
			get
			{
				return this._tarja > 0U;
			}
		}

		// Token: 0x06009C5A RID: 40026 RVA: 0x00192FA8 File Offset: 0x001911A8
		public static PveProfessionTable.RowData GetPveProfession(uint sceneID, uint profession)
		{
			bool flag = sceneID == 0U || profession == 0U;
			PveProfessionTable.RowData result;
			if (flag)
			{
				result = null;
			}
			else
			{
				string professionKey = XTeamDocument.GetProfessionKey(profession, sceneID);
				bool flag2 = !XTeamDocument.m_pveProfessions.ContainsKey(professionKey);
				if (flag2)
				{
					result = null;
				}
				else
				{
					result = XTeamDocument.m_pveProfessions[professionKey];
				}
			}
			return result;
		}

		// Token: 0x06009C5B RID: 40027 RVA: 0x00192FF8 File Offset: 0x001911F8
		public bool InTarja(uint profession)
		{
			return XTeamDocument.InTarja(this.currentDungeonID, profession);
		}

		// Token: 0x06009C5C RID: 40028 RVA: 0x00193018 File Offset: 0x00191218
		public static bool InTarja(uint dungeonID, uint profession)
		{
			return XTeamDocument.GetPveProfession(dungeonID, profession) != null;
		}

		// Token: 0x06009C5D RID: 40029 RVA: 0x00193034 File Offset: 0x00191234
		public bool ShowTarja(uint dungeonID)
		{
			bool isTarja = this.IsTarja;
			bool result;
			if (isTarja)
			{
				PveProfessionTable.RowData pveProfession = XTeamDocument.GetPveProfession(dungeonID, XSingleton<XAttributeMgr>.singleton.XPlayerData.TypeID);
				bool flag = pveProfession == null;
				if (flag)
				{
					result = false;
				}
				else
				{
					XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
					ExpeditionTable.RowData expeditionDataByID = specificDocument.GetExpeditionDataByID((int)dungeonID);
					result = (expeditionDataByID != null && XSingleton<XAttributeMgr>.singleton.XPlayerData.GetAttr(XAttributeDefine.XAttr_POWER_POINT_Basic) < expeditionDataByID.DisplayPPT);
				}
			}
			else
			{
				result = this.IsTarja;
			}
			return result;
		}

		// Token: 0x06009C5E RID: 40030 RVA: 0x001930BC File Offset: 0x001912BC
		public bool ShowTarja()
		{
			return this.ShowTarja(this.currentDungeonID);
		}

		// Token: 0x06009C5F RID: 40031 RVA: 0x001930DC File Offset: 0x001912DC
		public bool TryGetPveProfessionPPT(bool isTarja, uint profression, ref uint ppt)
		{
			bool flag = !isTarja;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				PveProfessionTable.RowData pveProfession = XTeamDocument.GetPveProfession(this.currentDungeonID, profression);
				bool flag2 = pveProfession == null;
				if (flag2)
				{
					result = false;
				}
				else
				{
					XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
					ExpeditionTable.RowData expeditionDataByID = specificDocument.GetExpeditionDataByID((int)this.currentDungeonID);
					bool flag3 = expeditionDataByID == null;
					if (flag3)
					{
						result = false;
					}
					else
					{
						bool flag4 = ppt < expeditionDataByID.DisplayPPT;
						if (flag4)
						{
							ppt = expeditionDataByID.DisplayPPT;
							result = true;
						}
						else
						{
							result = false;
						}
					}
				}
			}
			return result;
		}

		// Token: 0x06009C60 RID: 40032 RVA: 0x00193160 File Offset: 0x00191360
		public override void OnAttachToHost(XObject host)
		{
			base.OnAttachToHost(host);
			this._TeamList.Clear();
			this.currentExpInfo = null;
			this.currentDungeonID = 0U;
			this.currentDungeonName = string.Empty;
			this.currentCategoryName = string.Empty;
			this.currentDungeonType = TeamLevelType.TeamLevelNone;
			this.m_nMatchingTime = -1;
			this.m_AutoSelectFloatingLevel = XSingleton<XGlobalConfig>.singleton.GetInt("TeamAutoSelectFloatingLevel");
			this.m_SoloMatchType = KMatchType.KMT_NONE;
			this.m_bAutoMatching = false;
			this.TeamListSelectedCategories.Clear();
			this.TeamListSelectedCategories.Add(0);
		}

		// Token: 0x06009C61 RID: 40033 RVA: 0x001931F0 File Offset: 0x001913F0
		protected override void EventSubscribe()
		{
			base.EventSubscribe();
			base.RegisterEvent(XEventDefine.XEvent_JoinTeam, new XComponent.XEventHandler(this._OnJoinTeam));
			base.RegisterEvent(XEventDefine.XEvent_LeaveTeam, new XComponent.XEventHandler(this._OnLeaveTeam));
			base.RegisterEvent(XEventDefine.XEvent_FriendInfoChange, new XComponent.XEventHandler(this._OnFriendInfoChanged));
		}

		// Token: 0x06009C62 RID: 40034 RVA: 0x00193244 File Offset: 0x00191444
		public void InitTeamListSelection()
		{
			bool flag = this.TeamListSelectedCategories.Contains(0) && this.TeamListSelectedCategories.Count == 1;
			if (flag)
			{
				List<XTeamCategory> categories = this.ExpDoc.TeamCategoryMgr.m_Categories;
				for (int i = 0; i < categories.Count; i++)
				{
					this.TeamListSelectedCategories.Add(categories[i].category);
				}
			}
		}

		// Token: 0x06009C63 RID: 40035 RVA: 0x001932B8 File Offset: 0x001914B8
		private bool _OnJoinTeam(XEventArgs e)
		{
			DlgBase<XTeamConfirmView, XTeamConfirmBehaviour>.singleton.ClearInviteList();
			return true;
		}

		// Token: 0x06009C64 RID: 40036 RVA: 0x001932D8 File Offset: 0x001914D8
		private bool _OnLeaveTeam(XEventArgs e)
		{
			this.m_nMatchingTime = -1;
			this.ToggleVoting(false);
			bool flag = DlgBase<XTeamView, TabDlgBehaviour>.singleton.IsVisible();
			if (flag)
			{
				DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView();
			}
			this._UpdateOtherUI();
			return true;
		}

		// Token: 0x06009C65 RID: 40037 RVA: 0x0019331C File Offset: 0x0019151C
		private bool _OnFriendInfoChanged(XEventArgs e)
		{
			this.RefreshMyTeamView();
			return true;
		}

		// Token: 0x06009C66 RID: 40038 RVA: 0x00193338 File Offset: 0x00191538
		public override void OnEnterSceneFinally()
		{
			base.OnEnterSceneFinally();
			bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall;
			if (flag)
			{
				DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.SetTeamMatching(this.bSoloMatching);
				bool bInTeam = this.bInTeam;
				if (bInTeam)
				{
					DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.SetTeamMemberCount(this.MyTeam.members.Count);
				}
				else
				{
					DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.SetTeamMemberCount(0);
				}
			}
			else
			{
				bool flag2 = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.World;
				if (flag2)
				{
					bool bInTeam2 = this.bInTeam;
					if (bInTeam2)
					{
						bool flag3 = this.currentDungeonID != 2101U && this.currentDungeonID != 2102U && this.currentDungeonID != 2103U;
						if (flag3)
						{
							XSingleton<XUICacheMgr>.singleton.CacheUI(XSysDefine.XSys_Team, EXStage.Hall);
						}
					}
				}
			}
		}

		// Token: 0x06009C67 RID: 40039 RVA: 0x00193424 File Offset: 0x00191624
		public bool TryChangeToExpID(int expID)
		{
			bool flag = (ulong)this.currentDungeonID == (ulong)((long)expID);
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool bInTeam = this.bInTeam;
				if (bInTeam)
				{
					bool bIsLeader = this.bIsLeader;
					if (bIsLeader)
					{
						this.ReqTeamOp(TeamOperate.TEAM_CHANGE_EPXTEAMID, (ulong)((long)expID), null, TeamMemberType.TMT_NORMAL, null);
						result = true;
					}
					else
					{
						result = false;
					}
				}
				else
				{
					bool flag2 = this.currentDungeonID > 0U;
					this._SetCurrentDungeon(expID);
					bool flag3 = flag2;
					if (flag3)
					{
						this.CancelMatch();
					}
					bool flag4 = this.TeamListView != null && this.TeamListView.IsVisible();
					if (flag4)
					{
						this.TeamListView.OnCurrentDungeonChanged();
					}
					result = true;
				}
			}
			return result;
		}

		// Token: 0x06009C68 RID: 40040 RVA: 0x001934C8 File Offset: 0x001916C8
		public void TryAutoSelectExp()
		{
			bool flag = this.SoloMatchType > KMatchType.KMT_NONE;
			if (flag)
			{
				TeamLevelType teamLevelType = XTeamDocument.MatchType2TeamType(this.SoloMatchType);
				bool flag2 = teamLevelType > TeamLevelType.TeamLevelNone;
				if (flag2)
				{
					List<ExpeditionTable.RowData> expeditionList = this.ExpDoc.GetExpeditionList(teamLevelType);
					bool flag3 = expeditionList != null && expeditionList.Count > 0;
					if (flag3)
					{
						bool flag4 = this.TryChangeToExpID(expeditionList[0].DNExpeditionID);
						if (flag4)
						{
							return;
						}
					}
				}
			}
			bool flag5 = this.currentDungeonID > 0U;
			if (!flag5)
			{
				uint level = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
				int num = 0;
				int num2 = int.MaxValue;
				int num3 = int.MaxValue;
				for (int i = 0; i < this.ExpDoc.TeamCategoryMgr.m_Categories.Count; i++)
				{
					XTeamCategory xteamCategory = this.ExpDoc.TeamCategoryMgr.m_Categories[i];
					for (int j = 0; j < xteamCategory.expList.Count; j++)
					{
						ExpeditionTable.RowData rowData = xteamCategory.expList[j];
						bool flag6 = rowData == null;
						if (!flag6)
						{
							int num4 = Math.Abs((int)(rowData.DisplayLevel - level));
							bool flag7 = num3 < num4;
							if (!flag7)
							{
								bool flag8 = num4 == num3 && num2 < rowData.AutoSelectPriority;
								if (!flag8)
								{
									bool flag9 = !xteamCategory.IsExpOpened(rowData);
									if (!flag9)
									{
										num3 = num4;
										num2 = rowData.AutoSelectPriority;
										num = rowData.DNExpeditionID;
									}
								}
							}
						}
					}
				}
				bool flag10 = num != 0;
				if (flag10)
				{
					this.TryChangeToExpID(num);
				}
			}
		}

		// Token: 0x06009C69 RID: 40041 RVA: 0x00193680 File Offset: 0x00191880
		private void _SetCurrentDungeon(int dungeonID)
		{
			ExpeditionTable.RowData expeditionDataByID = this.ExpDoc.GetExpeditionDataByID(dungeonID);
			bool flag = expeditionDataByID != null;
			if (flag)
			{
				TeamLevelType type = (TeamLevelType)expeditionDataByID.Type;
				this._SetCurrentTeamInfo(expeditionDataByID);
				this.currentSceneData = null;
				uint sceneIDByExpID = this.ExpDoc.GetSceneIDByExpID(dungeonID);
				this.currentSceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(sceneIDByExpID);
				bool flag2 = type == TeamLevelType.TeamLevelTeamTower;
				if (flag2)
				{
					this.ExpDoc.ExpeditionId = expeditionDataByID.DNExpeditionID;
				}
			}
		}

		// Token: 0x06009C6A RID: 40042 RVA: 0x001936FC File Offset: 0x001918FC
		private void _SetCurrentTeamInfo(ExpeditionTable.RowData rowData)
		{
			bool flag = this.currentDungeonID != (uint)rowData.DNExpeditionID;
			if (flag)
			{
				bool flag2 = this.currentDungeonID == 0U;
				this.currentExpInfo = rowData;
				this.currentDungeonID = (uint)rowData.DNExpeditionID;
				this.currentDungeonName = XExpeditionDocument.GetFullName(rowData);
				this.currentDungeonType = (TeamLevelType)rowData.Type;
				this.currentCategoryName = XTeamCategory.GetCategoryName(rowData.Category);
				bool flag3 = !flag2 && this.bInTeam && !this.bIsLeader;
				if (flag3)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_LEADER_CHANGE_EXP", new object[]
					{
						this.currentDungeonName
					}), "fece00");
				}
			}
			bool flag4 = this.MyTeamView != null && this.MyTeamView.IsVisible();
			if (flag4)
			{
				this.MyTeamView.RefreshButtonStates();
			}
			bool flag5 = this.DungeonSelector != null && this.DungeonSelector.IsVisible();
			if (flag5)
			{
				this.DungeonSelector.SetCurrentDungeon(true);
			}
		}

		// Token: 0x06009C6B RID: 40043 RVA: 0x00193800 File Offset: 0x00191A00
		public XTeamBriefData GetTeamBriefByIndex(int index)
		{
			bool flag = index >= this._TeamList.Count;
			XTeamBriefData result;
			if (flag)
			{
				result = null;
			}
			else
			{
				result = this._TeamList[index];
			}
			return result;
		}

		// Token: 0x06009C6C RID: 40044 RVA: 0x00193838 File Offset: 0x00191A38
		public XTeamBriefData GetTeamBriefByID(int teamID)
		{
			for (int i = 0; i < this._TeamList.Count; i++)
			{
				bool flag = this._TeamList[i].teamID == teamID;
				if (flag)
				{
					return this._TeamList[i];
				}
			}
			return null;
		}

		// Token: 0x06009C6D RID: 40045 RVA: 0x00193890 File Offset: 0x00191A90
		public void ReqTeamList(bool bJustTarget)
		{
			this.m_bReqTeamListJustTarget = bJustTarget;
			if (bJustTarget)
			{
				bool flag = this.currentDungeonID > 0U;
				if (flag)
				{
					RpcC2M_FetchTeamListC2M rpcC2M_FetchTeamListC2M = new RpcC2M_FetchTeamListC2M();
					rpcC2M_FetchTeamListC2M.oArg.expID = this.currentDungeonID;
					XSingleton<XClientNetwork>.singleton.Send(rpcC2M_FetchTeamListC2M);
				}
			}
			else
			{
				bool flag2 = this.m_TeamListSelectedCategories.Count > 0;
				if (flag2)
				{
					RpcC2M_FetchTeamListC2M rpcC2M_FetchTeamListC2M2 = new RpcC2M_FetchTeamListC2M();
					foreach (int num in this.m_TeamListSelectedCategories)
					{
						bool flag3 = num != 0;
						if (flag3)
						{
							rpcC2M_FetchTeamListC2M2.oArg.categoryID.Add((uint)num);
						}
					}
					XSingleton<XClientNetwork>.singleton.Send(rpcC2M_FetchTeamListC2M2);
				}
				else
				{
					this.ClearTeamList();
					this.SortTeamListAndShow();
				}
			}
		}

		// Token: 0x06009C6E RID: 40046 RVA: 0x00193984 File Offset: 0x00191B84
		public void ClearTeamList()
		{
			for (int i = 0; i < this._TeamList.Count; i++)
			{
				this._TeamList[i].Recycle();
			}
			this._TeamList.Clear();
		}

		// Token: 0x06009C6F RID: 40047 RVA: 0x001939CC File Offset: 0x00191BCC
		public void OnGetTeamList(FetchTeamListRes oRes)
		{
			this.ClearTeamList();
			for (int i = 0; i < oRes.TheTeams.Count; i++)
			{
				TeamFullDataNtf teamFullDataNtf = oRes.TheTeams[i];
				bool flag = teamFullDataNtf.teamBrief.teamState == 1;
				if (!flag)
				{
					XTeamBriefData data = XDataPool<XTeamBriefData>.GetData();
					data.SetData(teamFullDataNtf.teamBrief, this.ExpDoc);
					data.SetMembers(teamFullDataNtf.members);
					this._TeamList.Add(data);
				}
			}
			this.SortTeamListAndShow();
			bool flag2 = this.bTryAutoJoin;
			if (flag2)
			{
				this._AutoJoin();
			}
		}

		// Token: 0x06009C70 RID: 40048 RVA: 0x00193A70 File Offset: 0x00191C70
		public void OnTeamInfoChanged(TeamChanged data)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("TeamInfoChanged", null, null, null, null, null);
			XTeamDocument.XPreviousTeamData xpreviousTeamData = new XTeamDocument.XPreviousTeamData(this);
			xpreviousTeamData.bNewTeam = false;
			bool flag = this._MyTeam == null;
			if (flag)
			{
				this._MyTeam = new XTeam();
				xpreviousTeamData.bNewTeam = true;
			}
			xpreviousTeamData.PreserveTeamData(this._MyTeam);
			this._MyTeam.PreUpdate();
			this._MyTeam.teamBrief.SetData(data.teamBrief, this.ExpDoc);
			bool flag2 = this._MyTeam.teamBrief.rowData == null;
			if (flag2)
			{
				bool flag3 = xpreviousTeamData.bNewTeam || xpreviousTeamData.expData != null;
				if (flag3)
				{
					XSingleton<UiUtility>.singleton.ShowModalDialog(XStringDefineProxy.GetString("LeaveTeamSinceNoConfig"), XStringDefineProxy.GetString(XStringDefine.COMMON_OK));
					this.ReqTeamOp(TeamOperate.TEAM_LEAVE, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				}
			}
			else
			{
				for (int i = 0; i < data.leaveMember.Count; i++)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("Try Leave Teammember ", data.leaveMember[i].ToString(), null, null, null, null);
					string text = this._MyTeam.RemoveMember(data.leaveMember[i]);
					bool flag4 = this._MyTeam.teamBrief.matchType != KMatchType.KMT_NONE && this._MyTeam.teamBrief.matchType != KMatchType.KMT_EXP;
					if (flag4)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_LEAVE_TEAM_MATCH", new object[]
						{
							text
						}), "fece00");
					}
					else
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_LEAVE_TEAM", new object[]
						{
							text
						}), "fece00");
					}
				}
				for (int j = 0; j < data.addMember.Count; j++)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("Try Add Teammember ", data.addMember[j].memberID.ToString(), null, null, null, null);
					this._MyTeam.AddMember(data.addMember[j]);
					bool flag5 = !xpreviousTeamData.bNewTeam;
					if (flag5)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_ADD_TEAM", new object[]
						{
							data.addMember[j].name
						}), "fece00");
					}
				}
				for (int k = 0; k < data.chgstateMember.Count; k++)
				{
					this._MyTeam.UpdateMember(data.chgstateMember[k]);
				}
				this._MyTeam.PostUpdate();
				bool flag6 = this.MyTeam.members.Count > 1;
				if (flag6)
				{
					XSingleton<XTutorialHelper>.singleton.HasTeam = true;
				}
				this._MyTeam.members.Sort();
				this._PostTeamInfoChanged(xpreviousTeamData, data.teamBrief);
				int num = data.addMember.Count - data.leaveMember.Count;
				bool flag7 = num != 0;
				if (flag7)
				{
					XTeamMemberCountChangedEventArgs @event = XEventPool<XTeamMemberCountChangedEventArgs>.GetEvent();
					@event.oldCount = (uint)(this._MyTeam.members.Count - num);
					@event.newCount = (uint)this._MyTeam.members.Count;
					@event.Firer = XSingleton<XGame>.singleton.Doc;
					XSingleton<XEventMgr>.singleton.FireEvent(@event);
				}
			}
		}

		// Token: 0x06009C71 RID: 40049 RVA: 0x00193E04 File Offset: 0x00192004
		private void _PostTeamInfoChanged(XTeamDocument.XPreviousTeamData previousData, TeamBrief brief)
		{
			this.teamLeagueName = brief.extrainfo.league_teamname;
			bool flag = previousData.bNewTeam || this.currentDungeonID != this._MyTeam.teamBrief.dungeonID || this._MyTeam.bLeaderChanged;
			if (flag)
			{
				this._SetCurrentDungeon((int)this._MyTeam.teamBrief.dungeonID);
			}
			bool bNewTeam = previousData.bNewTeam;
			if (bNewTeam)
			{
				bool flag2 = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall && !XSingleton<XGame>.singleton.switchScene;
				if (flag2)
				{
					bool flag3 = this.AllListView != null && this.AllListView.IsVisible();
					if (flag3)
					{
						this.AllListView.SetVisibleWithAnimation(false, new DlgBase<XTeamListView, XTeamListBehaviour>.OnAnimationOver(DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView));
					}
					else
					{
						bool flag4 = DlgBase<XTeamInvitedListView, XTeamInvitedListBehaviour>.singleton.IsVisible();
						if (flag4)
						{
							DlgBase<XTeamInvitedListView, XTeamInvitedListBehaviour>.singleton.SetVisibleWithAnimation(false, new DlgBase<XTeamInvitedListView, XTeamInvitedListBehaviour>.OnAnimationOver(DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView));
						}
						else
						{
							ExpeditionTable.RowData expeditionDataByID = this.ExpDoc.GetExpeditionDataByID((int)this.currentDungeonID);
							bool flag5 = expeditionDataByID != null && XSingleton<XScene>.singleton.SceneType != SceneType.SKYCITY_WAITING;
							if (flag5)
							{
								bool flag6 = expeditionDataByID.fastmatch == 0 || DlgBase<XTeamView, TabDlgBehaviour>.singleton.IsVisible();
								if (flag6)
								{
									DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView();
								}
							}
						}
					}
					XSingleton<XVirtualTab>.singleton.Cancel();
				}
				this.password = brief.password;
				XJoinTeamEventArgs @event = XEventPool<XJoinTeamEventArgs>.GetEvent();
				@event.dungeonID = this._MyTeam.teamBrief.dungeonID;
				@event.Firer = XSingleton<XGame>.singleton.Doc;
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
			previousData.CheckNewTeamData(this._MyTeam);
			this.RefreshMyTeamView();
			bool bVoting = this.bVoting;
			if (bVoting)
			{
				DlgBase<XTeamBattleConfirmView, XTeamBattleConfirmBehaviour>.singleton.RefreshFightVote();
			}
			bool bMatching = this.bMatching;
			if (bMatching)
			{
				bool flag7 = this.m_nMatchingTime < 0;
				if (flag7)
				{
					this.m_nMatchingTime = 0;
					this.m_fMatchingTime = Time.time;
				}
			}
			else
			{
				this.m_nMatchingTime = -1;
			}
			this._UpdateOtherUI();
		}

		// Token: 0x06009C72 RID: 40050 RVA: 0x00194034 File Offset: 0x00192234
		public void ReqTeamOp(TeamOperate op, ulong param = 0UL, object o = null, TeamMemberType memberType = TeamMemberType.TMT_NORMAL, string account = null)
		{
			XTeamDocument.bFromHyperLink = false;
			bool flag = this._MyTeam == null;
			if (flag)
			{
				bool flag2 = op == TeamOperate.TEAM_LEAVE || op == TeamOperate.TEAM_TOGGLE_READY;
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("Not in a team.", null, null, null, null, null);
					return;
				}
			}
			else
			{
				bool flag3 = this._MyTeam != null;
				if (flag3)
				{
					bool flag4 = op == TeamOperate.TEAM_CREATE || op == TeamOperate.TEAM_JOIN;
					if (flag4)
					{
						XSingleton<XDebug>.singleton.AddErrorLog("Already in a team.", null, null, null, null, null);
						return;
					}
				}
			}
			RpcC2M_TeamRequestC2M rpcC2M_TeamRequestC2M = new RpcC2M_TeamRequestC2M();
			switch (op)
			{
			case TeamOperate.TEAM_CREATE:
				rpcC2M_TeamRequestC2M.oArg.expID = this.currentDungeonID;
				rpcC2M_TeamRequestC2M.oArg.param = param;
				rpcC2M_TeamRequestC2M.oArg.password = this.password;
				goto IL_2CE;
			case TeamOperate.TEAM_JOIN:
			{
				rpcC2M_TeamRequestC2M.oArg.teamID = (int)param;
				XTeamBriefData teamBriefByID = this.GetTeamBriefByID((int)param);
				bool flag5 = teamBriefByID != null;
				if (flag5)
				{
					rpcC2M_TeamRequestC2M.oArg.expID = teamBriefByID.dungeonID;
				}
				rpcC2M_TeamRequestC2M.oArg.password = this.password;
				goto IL_2CE;
			}
			case TeamOperate.TEAM_LEAVE:
				rpcC2M_TeamRequestC2M.oArg.param = param;
				goto IL_2CE;
			case TeamOperate.TEAM_QUERYCOUNT:
				goto IL_2CE;
			case TeamOperate.TEAM_KICK:
			case TeamOperate.TEAM_TRAHS_LEADER:
				rpcC2M_TeamRequestC2M.oArg.roleid = param;
				goto IL_2CE;
			case TeamOperate.TEAM_START_BATTLE:
			{
				bool flag6 = o != null;
				if (flag6)
				{
					TeamExtraInfo teamExtraInfo = new TeamExtraInfo();
					teamExtraInfo.league_teamname = (o as string);
					rpcC2M_TeamRequestC2M.oArg.extrainfo = teamExtraInfo;
				}
				goto IL_2CE;
			}
			case TeamOperate.TEAM_CHANGE_EPXTEAMID:
				rpcC2M_TeamRequestC2M.oArg.expID = (uint)param;
				goto IL_2CE;
			case TeamOperate.TEAM_INVITE:
				rpcC2M_TeamRequestC2M.oArg.roleid = param;
				rpcC2M_TeamRequestC2M.oArg.account = account;
				goto IL_2CE;
			case TeamOperate.TEAM_START_MATCH:
			case TeamOperate.TEAM_STOP_MATCH:
			case TeamOperate.TEAM_DOWN_MATCH:
				rpcC2M_TeamRequestC2M.oArg.expID = this.currentDungeonID;
				rpcC2M_TeamRequestC2M.oArg.param = param;
				goto IL_2CE;
			case TeamOperate.TEAM_PPTLIMIT:
			case TeamOperate.TEAM_COSTTYPE:
			{
				TeamExtraInfo teamExtraInfo2 = o as TeamExtraInfo;
				bool flag7 = teamExtraInfo2 == null;
				if (flag7)
				{
					return;
				}
				rpcC2M_TeamRequestC2M.oArg.extrainfo = teamExtraInfo2;
				goto IL_2CE;
			}
			case TeamOperate.TEAM_CHANGE_PASSWORD:
				rpcC2M_TeamRequestC2M.oArg.password = (o as string);
				goto IL_2CE;
			case TeamOperate.TEAM_MEMBER_TYPE:
				rpcC2M_TeamRequestC2M.oArg.membertype = memberType;
				goto IL_2CE;
			}
			bool flag8 = this._MyTeam == null;
			if (flag8)
			{
				return;
			}
			rpcC2M_TeamRequestC2M.oArg.teamID = this._MyTeam.teamBrief.teamID;
			rpcC2M_TeamRequestC2M.oArg.expID = this._MyTeam.teamBrief.dungeonID;
			IL_2CE:
			rpcC2M_TeamRequestC2M.oArg.request = op;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_TeamRequestC2M);
		}

		// Token: 0x06009C73 RID: 40051 RVA: 0x00194328 File Offset: 0x00192528
		private string _GetRoleName(ulong roleID)
		{
			bool flag = XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID == roleID;
			string result;
			if (flag)
			{
				result = XStringDefineProxy.GetString("YOU");
			}
			else
			{
				bool flag2 = this.MyTeam != null;
				if (flag2)
				{
					XTeamMember xteamMember = this.MyTeam.FindMember(roleID);
					bool flag3 = xteamMember != null;
					if (flag3)
					{
						result = xteamMember.name;
					}
					else
					{
						result = XStringDefineProxy.GetString("THIS_ROLE");
					}
				}
				else
				{
					result = string.Empty;
				}
			}
			return result;
		}

		// Token: 0x06009C74 RID: 40052 RVA: 0x001943A0 File Offset: 0x001925A0
		public void ProcessTeamOPErrorCode(ErrorCode errcode, ulong roleID)
		{
			ErrorCode errorCode = errcode;
			if (errorCode != ErrorCode.ERR_TEAM_NEED_ATLEAST_2_MEMBER)
			{
				if (errorCode != ErrorCode.ERR_TEAM_SERVER_OPEN_TIME)
				{
					bool flag = roleID > 0UL;
					if (flag)
					{
						string text = this._GetRoleName(roleID);
						bool flag2 = string.IsNullOrEmpty(text);
						if (flag2)
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(errcode, "fece00");
						}
						else
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString(string.Format("TEAM_{0}", errcode.ToString()), new object[]
							{
								text
							}), "fece00");
						}
					}
					else
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(errcode, "fece00");
					}
				}
			}
			else
			{
				string key = string.Format("TEAM_{0}", errcode.ToString());
				XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString(key, new object[]
				{
					this.currentExpInfo.PlayerLeastNumber
				}), "fece00");
			}
		}

		// Token: 0x06009C75 RID: 40053 RVA: 0x00194498 File Offset: 0x00192698
		public void OnGetTeamOp(TeamOPArg oArg, TeamOPRes oRes)
		{
			bool flag = oRes.result > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				this.ProcessTeamOPErrorCode(oRes.result, oRes.problem_roleid);
				ErrorCode result = oRes.result;
				if (result <= ErrorCode.ERR_SCENE_TODYCOUNTLIMIT)
				{
					if (result == ErrorCode.ERR_SCENE_NOFATIGUE)
					{
						bool flag2 = oRes.problem_roleid == 0UL || XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID == oRes.problem_roleid;
						if (flag2)
						{
							DlgBase<XPurchaseView, XPurchaseBehaviour>.singleton.ReqQuickCommonPurchase(ItemEnum.FATIGUE);
						}
						goto IL_155;
					}
					if (result != ErrorCode.ERR_SCENE_TODYCOUNTLIMIT)
					{
						goto IL_155;
					}
				}
				else if (result != ErrorCode.ERR_TEAM_NEST_DAYCOUNT)
				{
					if (result != ErrorCode.ERR_TEAM_SERVER_OPEN_TIME)
					{
						goto IL_155;
					}
					string text = this._GetRoleName(oRes.problem_roleid);
					bool flag3 = text == null;
					if (flag3)
					{
						text = string.Empty;
					}
					XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<UiUtility>.singleton.TimeFormatSince1970((int)oRes.opentime, XStringDefineProxy.GetString("TEAM_ERR_TEAM_SERVER_OPEN_TIME", new object[]
					{
						text
					}), true), "fece00");
					goto IL_155;
				}
				bool flag4 = oRes.problem_roleid == 0UL || XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID == oRes.problem_roleid;
				if (flag4)
				{
					ExpeditionTable.RowData expeditionDataByID = this.ExpDoc.GetExpeditionDataByID((int)oArg.expID);
					bool flag5 = expeditionDataByID != null;
					if (flag5)
					{
						TeamLevelType type = (TeamLevelType)expeditionDataByID.Type;
						DlgBase<XBuyCountView, XBuyCountBehaviour>.singleton.PassiveShow(type);
					}
				}
				IL_155:
				TeamOperate request = oArg.request;
				if (request == TeamOperate.TEAM_START_MATCH)
				{
					this.m_bAutoMatching = false;
				}
			}
			else
			{
				TeamOperate request2 = oArg.request;
				if (request2 <= TeamOperate.TEAM_STOP_MATCH)
				{
					switch (request2)
					{
					case TeamOperate.TEAM_CREATE:
					{
						bool flag6 = oArg.param > 0UL;
						if (flag6)
						{
							this.ReqTeamOp(TeamOperate.TEAM_INVITE, oArg.param, null, TeamMemberType.TMT_NORMAL, null);
						}
						this.ExpDoc.TryShowPveAttrTips(oArg.expID);
						break;
					}
					case TeamOperate.TEAM_JOIN:
						this.TryChangeToExpID((int)oArg.expID);
						break;
					case TeamOperate.TEAM_LEAVE:
					{
						bool flag7 = oArg.param > 0UL;
						if (flag7)
						{
							bool bHasPwd = (oArg.param & 4294967296UL) > 0UL;
							ulong num = oArg.param /*& (ulong)-1*/;
							XTeamView.TryJoinTeam((int)num, bHasPwd);
						}
						break;
					}
					default:
						switch (request2)
						{
						case TeamOperate.TEAM_CHANGE_EPXTEAMID:
							this._SetCurrentDungeon((int)oArg.expID);
							break;
						case TeamOperate.TEAM_INVITE:
						{
							bool flag8 = oArg.accountSpecified && !string.IsNullOrEmpty(oArg.account);
							if (!flag8)
							{
								XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_INVITE_SUCCESS"), "fece00");
							}
							break;
						}
						case TeamOperate.TEAM_START_MATCH:
						{
							bool bAutoMatching = this.m_bAutoMatching;
							if (bAutoMatching)
							{
								DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView();
							}
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("BEGIN_MATCH"), "fece00");
							break;
						}
						case TeamOperate.TEAM_STOP_MATCH:
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("CANCEL_MATCH"), "fece00");
							break;
						}
						break;
					}
				}
				else if (request2 != TeamOperate.TEAM_CHANGE_PASSWORD)
				{
					if (request2 == TeamOperate.TEAM_MEMBER_TYPE)
					{
						bool flag9 = TeamMemberType.TMT_USETICKET == oArg.membertype;
						if (flag9)
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_TEAM_TICKET_SUCCESS"), "fece00");
						}
						else
						{
							bool flag10 = TeamMemberType.TMT_HELPER == oArg.membertype;
							if (flag10)
							{
								XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWITCH_TO_HELPER"), "fece00");
							}
						}
					}
				}
				else
				{
					bool flag11 = string.IsNullOrEmpty(oArg.password);
					if (flag11)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_REMOVE_PWD"), "fece00");
					}
					else
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_SET_PWD"), "fece00");
					}
				}
				bool flag12 = XTeamDocument.bFromHyperLink;
				if (flag12)
				{
					DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView();
				}
			}
		}

		// Token: 0x06009C76 RID: 40054 RVA: 0x00194880 File Offset: 0x00192A80
		public void OnLeaveTeam(LeaveTeamType errType)
		{
			bool flag = this._MyTeam == null;
			if (flag)
			{
				bool flag2 = errType != LeaveTeamType.LTT_MS_CRASH;
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("Not in team now. Shouldnt receive leave team ptc.", null, null, null, null, null);
				}
			}
			else
			{
				LeaveTeamType leaveTeamType = errType;
				if (leaveTeamType != LeaveTeamType.LTT_BY_SELF)
				{
					if (leaveTeamType - LeaveTeamType.LTT_DEL_ROBOT > 1)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString(errType.ToString()), "fece00");
					}
				}
				else
				{
					bool flag3 = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall;
					if (flag3)
					{
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_LEAVE_TEAM", new object[]
						{
							XStringDefineProxy.GetString("YOU")
						}), "fece00");
					}
				}
				XLeaveTeamEventArgs @event = XEventPool<XLeaveTeamEventArgs>.GetEvent();
				@event.dungeonID = this._MyTeam.teamBrief.dungeonID;
				@event.Firer = XSingleton<XGame>.singleton.Doc;
				this._MyTeam = null;
				this.password = "";
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
		}

		// Token: 0x06009C77 RID: 40055 RVA: 0x00194988 File Offset: 0x00192B88
		public void RefreshMyTeamView()
		{
			bool flag = this.MyTeamView != null && this.MyTeamView.IsVisible();
			if (flag)
			{
				this.MyTeamView.RefreshPage();
			}
		}

		// Token: 0x06009C78 RID: 40056 RVA: 0x001949BC File Offset: 0x00192BBC
		public void RefreshRedPoint()
		{
			this._UpdateOtherUI();
		}

		// Token: 0x06009C79 RID: 40057 RVA: 0x001949C8 File Offset: 0x00192BC8
		private void _UpdateOtherUI()
		{
			bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded() && DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible();
			if (flag)
			{
				bool flag2 = XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_PVP && XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_HEROBATTLE;
				if (flag2)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.TeamMonitor.TeamInfoChangeOnBattle(this._MyTeam);
				}
			}
			bool flag3 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible();
			if (flag3)
			{
				bool flag4 = !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.IsShowingTaskTab;
				if (flag4)
				{
					DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.TeamHandler.TeamInfoChange(this._MyTeam);
				}
			}
		}

		// Token: 0x06009C7A RID: 40058 RVA: 0x00194A78 File Offset: 0x00192C78
		public override void Update(float fDeltaT)
		{
			base.Update(fDeltaT);
			bool flag = this.MyTeam != null;
			if (flag)
			{
				this.MyTeam.OnUpdate();
			}
			bool flag2 = this.m_nMatchingTime >= 0;
			if (flag2)
			{
				int num = (int)(Time.time - this.m_fMatchingTime);
				bool flag3 = num > this.m_nMatchingTime;
				if (flag3)
				{
					this.m_nMatchingTime = num;
				}
			}
		}

		// Token: 0x06009C7B RID: 40059 RVA: 0x00194AE0 File Offset: 0x00192CE0
		private void _AutoJoin()
		{
			this.bTryAutoJoin = false;
			foreach (XTeamBriefData xteamBriefData in this._TeamList)
			{
				bool flag = xteamBriefData.state == XTeamState.TS_NOT_FULL;
				if (flag)
				{
					this.ReqTeamOp(TeamOperate.TEAM_JOIN, (ulong)((long)xteamBriefData.teamID), null, TeamMemberType.TMT_NORMAL, null);
					return;
				}
			}
			XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TEAM_AUTOJOIN_FAILED"), "fece00");
		}

		// Token: 0x06009C7C RID: 40060 RVA: 0x00194B74 File Offset: 0x00192D74
		public void ToggleVoting(bool bVote)
		{
			this._bVoting = bVote;
			bool bVoting = this._bVoting;
			if (bVoting)
			{
				DlgBase<XTeamBattleConfirmView, XTeamBattleConfirmBehaviour>.singleton.StartFightVote();
			}
			else
			{
				bool flag = !this.bInTeam || this.MyTeam.teamBrief.actualState != TeamState.TEAM_IN_BATTLE;
				if (flag)
				{
					bool flag2 = DlgBase<XTeamBattleConfirmView, XTeamBattleConfirmBehaviour>.singleton.IsVisible();
					if (flag2)
					{
						DlgBase<XTeamBattleConfirmView, XTeamBattleConfirmBehaviour>.singleton.SetVisibleWithAnimation(false, null);
					}
				}
			}
		}

		// Token: 0x06009C7D RID: 40061 RVA: 0x00194BE4 File Offset: 0x00192DE4
		public static KMatchType TeamType2MatchType(TeamLevelType type)
		{
			KMatchType result;
			if (type != TeamLevelType.TeamLevelCaptainPVP)
			{
				switch (type)
				{
				case TeamLevelType.TeamLevelHeroBattle:
					return KMatchType.KMT_HERO;
				case TeamLevelType.TeamLevelTeamLeague:
					return KMatchType.KMT_LEAGUE;
				case TeamLevelType.TeamLevelMultiPK:
					return KMatchType.KMT_PKTWO;
				case TeamLevelType.TeamLevelWeekendParty:
					return KMatchType.KMT_WEEKEND_ACT;
				case TeamLevelType.TeamLevelMoba:
					return KMatchType.KMT_MOBA;
				case TeamLevelType.TeamLevelCustomPKTwo:
					return KMatchType.KMT_CUSTOM_PKTWO;
				}
				result = KMatchType.KMT_EXP;
			}
			else
			{
				result = KMatchType.KMT_PVP;
			}
			return result;
		}

		// Token: 0x06009C7E RID: 40062 RVA: 0x00194C4C File Offset: 0x00192E4C
		public static TeamLevelType MatchType2TeamType(KMatchType type)
		{
			switch (type)
			{
			case KMatchType.KMT_PVP:
				return TeamLevelType.TeamLevelCaptainPVP;
			case KMatchType.KMT_HERO:
				return TeamLevelType.TeamLevelHeroBattle;
			case KMatchType.KMT_LEAGUE:
				return TeamLevelType.TeamLevelTeamLeague;
			case KMatchType.KMT_PKTWO:
				return TeamLevelType.TeamLevelMultiPK;
			case KMatchType.KMT_MOBA:
				return TeamLevelType.TeamLevelMoba;
			case KMatchType.KMT_WEEKEND_ACT:
				return TeamLevelType.TeamLevelWeekendParty;
			case KMatchType.KMT_CUSTOM_PKTWO:
				return TeamLevelType.TeamLevelCustomPKTwo;
			}
			return TeamLevelType.TeamLevelNone;
		}

		// Token: 0x06009C7F RID: 40063 RVA: 0x00194CB4 File Offset: 0x00192EB4
		public bool IsSoloMatching(TeamLevelType type)
		{
			return this.SoloMatchType == XTeamDocument.TeamType2MatchType(type);
		}

		// Token: 0x06009C80 RID: 40064 RVA: 0x00194CD4 File Offset: 0x00192ED4
		public bool IsMatching(TeamLevelType type)
		{
			bool bInTeam = this.bInTeam;
			bool result;
			if (bInTeam)
			{
				result = (this._MyTeam.teamBrief.matchType == XTeamDocument.TeamType2MatchType(type));
			}
			else
			{
				result = this.IsSoloMatching(type);
			}
			return result;
		}

		// Token: 0x06009C81 RID: 40065 RVA: 0x00194D14 File Offset: 0x00192F14
		public void CancelMatch()
		{
			bool flag = this.bInTeam || !this.bSoloMatching;
			if (!flag)
			{
				bool flag2 = this.SoloMatchType != KMatchType.KMT_EXP;
				if (flag2)
				{
					TeamLevelType teamLevelType = XTeamDocument.MatchType2TeamType(this.SoloMatchType);
					bool flag3 = teamLevelType == this.currentDungeonType;
					if (flag3)
					{
						return;
					}
				}
				KMatchType soloMatchType = this.SoloMatchType;
				if (soloMatchType != KMatchType.KMT_EXP)
				{
					if (soloMatchType - KMatchType.KMT_PVP <= 1)
					{
						this.ReqMatchStateChange(this.SoloMatchType, KMatchOp.KMATCH_OP_STOP, false);
					}
				}
				else
				{
					this.ReqTeamOp(TeamOperate.TEAM_STOP_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				}
			}
		}

		// Token: 0x06009C82 RID: 40066 RVA: 0x00194DA4 File Offset: 0x00192FA4
		public void ForceMatching(bool matching)
		{
			bool flag = !matching;
			if (flag)
			{
				this.ReqTeamOp(TeamOperate.TEAM_STOP_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				this.m_bAutoMatching = false;
			}
			else
			{
				this.ReqTeamOp(TeamOperate.TEAM_START_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				this.m_bAutoMatching = true;
			}
		}

		// Token: 0x06009C83 RID: 40067 RVA: 0x00194DEA File Offset: 0x00192FEA
		public void SetAndMatch(int expid)
		{
			this.TryChangeToExpID(expid);
			DlgBase<XTeamView, TabDlgBehaviour>.singleton.ShowTeamView();
		}

		// Token: 0x06009C84 RID: 40068 RVA: 0x00194E00 File Offset: 0x00193000
		public void ToggleMatching()
		{
			bool flag = this.IsMatching(this.currentDungeonType);
			if (flag)
			{
				this.ReqTeamOp(TeamOperate.TEAM_STOP_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
			}
			else
			{
				bool flag2 = this.currentDungeonType == TeamLevelType.TeamLevelTeamTower && this.ExpDoc.EnlargeMatch;
				if (flag2)
				{
					this.ReqTeamOp(TeamOperate.TEAM_DOWN_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				}
				else
				{
					this.ReqTeamOp(TeamOperate.TEAM_START_MATCH, 0UL, null, TeamMemberType.TMT_NORMAL, null);
				}
			}
			this.m_bAutoMatching = false;
		}

		// Token: 0x06009C85 RID: 40069 RVA: 0x00194E70 File Offset: 0x00193070
		private bool _ForceStart(IXUIButton btn)
		{
			this.ReqTeamOp(TeamOperate.TEAM_START_BATTLE_REMOVE_DISAGREE_MEMBER, 0UL, null, TeamMemberType.TMT_NORMAL, null);
			XSingleton<UiUtility>.singleton.CloseModalDlg();
			return true;
		}

		// Token: 0x06009C86 RID: 40070 RVA: 0x00194E9C File Offset: 0x0019309C
		public int GetCurrentDayMaxCount()
		{
			return this.ExpDoc.GetDayMaxCount(this.currentDungeonType, this.currentSceneData);
		}

		// Token: 0x06009C87 RID: 40071 RVA: 0x00194EC8 File Offset: 0x001930C8
		public int GetMyDayCount()
		{
			return this.ExpDoc.GetDayCount(this.currentDungeonType, this.currentSceneData);
		}

		// Token: 0x06009C88 RID: 40072 RVA: 0x00194EF4 File Offset: 0x001930F4
		public void ReqSceneDayCount()
		{
			RpcC2G_QuerySceneDayCount rpcC2G_QuerySceneDayCount = new RpcC2G_QuerySceneDayCount();
			rpcC2G_QuerySceneDayCount.oArg.type = 1U;
			List<XTeamCategory> categories = this.ExpDoc.TeamCategoryMgr.m_Categories;
			for (int i = 0; i < categories.Count; i++)
			{
				bool flag = !categories[i].HasOpened();
				if (!flag)
				{
					List<ExpeditionTable.RowData> expList = categories[i].expList;
					for (int j = 0; j < expList.Count; j++)
					{
						uint sceneIDByExpID = this.ExpDoc.GetSceneIDByExpID(expList[j].DNExpeditionID);
						bool flag2 = sceneIDByExpID == 0U;
						if (flag2)
						{
							break;
						}
						rpcC2G_QuerySceneDayCount.oArg.groupid.Add(sceneIDByExpID);
					}
				}
			}
			XSingleton<XClientNetwork>.singleton.Send(rpcC2G_QuerySceneDayCount);
		}

		// Token: 0x06009C89 RID: 40073 RVA: 0x00194FCC File Offset: 0x001931CC
		public void OnGetSceneDayCount(QuerySceneDayCountRes oRes)
		{
			bool flag = !DlgBase<XTeamView, TabDlgBehaviour>.singleton.IsVisible();
			if (!flag)
			{
				this.TryAutoSelectExp();
			}
		}

		// Token: 0x06009C8A RID: 40074 RVA: 0x00194FF4 File Offset: 0x001931F4
		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
			RpcC2M_TeamRequestC2M rpcC2M_TeamRequestC2M = new RpcC2M_TeamRequestC2M();
			rpcC2M_TeamRequestC2M.oArg.request = TeamOperate.TEAM_GET_FULL_DATA;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_TeamRequestC2M);
		}

		// Token: 0x06009C8B RID: 40075 RVA: 0x00195024 File Offset: 0x00193224
		public void OnTeamFullDataNotify(TeamFullDataNtf data)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("Team reconnect", null, null, null, null, null);
			bool flag = !data.hasTeam && this.bInTeam;
			if (flag)
			{
				this.OnLeaveTeam(LeaveTeamType.LTT_BY_SELF);
			}
			else
			{
				bool hasTeam = data.hasTeam;
				if (hasTeam)
				{
					XTeamDocument.XPreviousTeamData previousData = new XTeamDocument.XPreviousTeamData(this);
					bool flag2 = this.MyTeam == null;
					if (flag2)
					{
						this._MyTeam = new XTeam();
						previousData.bNewTeam = true;
					}
					previousData.PreserveTeamData(this._MyTeam);
					this._MyTeam.Reset();
					this._MyTeam.PreUpdate();
					this._MyTeam.teamBrief.SetData(data.teamBrief, this.ExpDoc);
					bool flag3 = this._MyTeam.teamBrief.rowData == null;
					if (flag3)
					{
						XSingleton<UiUtility>.singleton.ShowModalDialog(XStringDefineProxy.GetString("LeaveTeamSinceNoConfig"), XStringDefineProxy.GetString(XStringDefine.COMMON_OK));
						this.ReqTeamOp(TeamOperate.TEAM_LEAVE, 0UL, null, TeamMemberType.TMT_NORMAL, null);
					}
					else
					{
						for (int i = 0; i < data.members.Count; i++)
						{
							this._MyTeam.AddMember(data.members[i]);
						}
						this._MyTeam.PostUpdate();
						bool flag4 = this.MyTeam.members.Count > 1;
						if (flag4)
						{
							XSingleton<XTutorialHelper>.singleton.HasTeam = true;
						}
						this._MyTeam.members.Sort();
						this._PostTeamInfoChanged(previousData, data.teamBrief);
					}
				}
			}
		}

		// Token: 0x06009C8C RID: 40076 RVA: 0x001951BC File Offset: 0x001933BC
		public void ReqMatchStateChange(KMatchType type, KMatchOp op, bool isTeamMatch)
		{
			XSingleton<XDebug>.singleton.AddGreenLog(string.Concat(new object[]
			{
				"KKSG.KMatchType:",
				type,
				"   KKSG.KMatchOp:",
				op,
				"\nisTeamMatch:",
				isTeamMatch.ToString()
			}), null, null, null, null, null);
			RpcC2M_KMatchCommonReq rpcC2M_KMatchCommonReq = new RpcC2M_KMatchCommonReq();
			rpcC2M_KMatchCommonReq.oArg.type = type;
			rpcC2M_KMatchCommonReq.oArg.op = op;
			rpcC2M_KMatchCommonReq.oArg.isteam = isTeamMatch;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_KMatchCommonReq);
		}

		// Token: 0x06009C8D RID: 40077 RVA: 0x00195254 File Offset: 0x00193454
		public void OnRoleMatchStateNotify(RoleStateMatch matchData)
		{
			bool flag = matchData.matchtype > KMatchType.KMT_NONE;
			if (flag)
			{
				bool flag2 = this.m_SoloMatchType != matchData.matchtype;
				if (flag2)
				{
					this.m_nMatchingTime = 0;
					this.m_fMatchingTime = Time.time;
				}
			}
			else
			{
				this.m_nMatchingTime = -1;
			}
			this.m_SoloMatchType = matchData.matchtype;
			bool flag3 = this.TeamListView != null && this.TeamListView.IsVisible();
			if (flag3)
			{
				this.TeamListView.RefreshPage();
			}
			bool flag4 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsLoaded();
			if (flag4)
			{
				DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.SetTeamMatching(this.bSoloMatching);
			}
			bool flag5 = DlgBase<XCaptainPVPView, XCaptainPVPBehaviour>.singleton.IsVisible();
			if (flag5)
			{
				DlgBase<XCaptainPVPView, XCaptainPVPBehaviour>.singleton.RefreshButtonState();
			}
			bool flag6 = DlgBase<HeroBattleDlg, HeroBattleBehaviour>.singleton.IsVisible();
			if (flag6)
			{
				DlgBase<HeroBattleDlg, HeroBattleBehaviour>.singleton.Refresh();
			}
			bool flag7 = DlgBase<MobaEntranceView, MobaEntranceBehaviour>.singleton.IsVisible();
			if (flag7)
			{
				DlgBase<MobaEntranceView, MobaEntranceBehaviour>.singleton.RefreshMatch();
			}
			bool flag8 = DlgBase<XQualifyingView, XQualifyingBehaviour>.singleton.IsVisible();
			if (flag8)
			{
				DlgBase<XQualifyingView, XQualifyingBehaviour>.singleton.RefreshMatch2v2Btn();
			}
			bool flag9 = DlgBase<ActivityWeekendPartyView, ActivityWeekendPartyBehaviour>.singleton.IsVisible();
			if (flag9)
			{
				DlgBase<ActivityWeekendPartyView, ActivityWeekendPartyBehaviour>.singleton.RefreshMatchBtn();
			}
		}

		// Token: 0x06009C8E RID: 40078 RVA: 0x00195390 File Offset: 0x00193590
		public static bool GoSingleBattleBeforeNeed(ButtonClickEventHandler handler, IXUIButton btn)
		{
			XTeamDocument._EventDel = null;
			XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			bool bCanEnter = XTeamDocument._bCanEnter;
			bool result;
			if (bCanEnter)
			{
				XTeamDocument._bCanEnter = false;
				result = false;
			}
			else
			{
				XTeamDocument._EnterButton = btn;
				XTeamDocument._EnterHandler = handler;
				bool bInTeam = specificDocument.bInTeam;
				if (bInTeam)
				{
					result = XTeamDocument.ShouldLeaveTeamFirst();
				}
				else
				{
					result = XTeamDocument.ShouldTips();
				}
			}
			return result;
		}

		// Token: 0x06009C8F RID: 40079 RVA: 0x001953EC File Offset: 0x001935EC
		public static bool GoSingleBattleBeforeNeed(EventDelegate del)
		{
			XTeamDocument._EnterHandler = null;
			XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			bool bCanEnter = XTeamDocument._bCanEnter;
			bool result;
			if (bCanEnter)
			{
				XTeamDocument._bCanEnter = false;
				result = false;
			}
			else
			{
				XTeamDocument._EventDel = del;
				bool bInTeam = specificDocument.bInTeam;
				if (bInTeam)
				{
					result = XTeamDocument.ShouldLeaveTeamFirst();
				}
				else
				{
					result = XTeamDocument.ShouldTips();
				}
			}
			return result;
		}

		// Token: 0x06009C90 RID: 40080 RVA: 0x00195444 File Offset: 0x00193644
		public static bool ShouldTips()
		{
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SKYCITY_WAITING || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HORSE || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_BIGMELEE_READY || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_BATTLEFIELD_READY;
			bool result;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowModalDialog(XStringDefineProxy.GetString("SKY_ARENA_LEAVE_SINGLE_TIP"), XStringDefineProxy.GetString(XStringDefine.COMMON_OK), XStringDefineProxy.GetString(XStringDefine.COMMON_CANCEL), new ButtonClickEventHandler(XTeamDocument._Enter));
				result = true;
			}
			else
			{
				result = false;
			}
			return result;
		}

		// Token: 0x06009C91 RID: 40081 RVA: 0x001954C8 File Offset: 0x001936C8
		public static bool ShouldLeaveTeamFirst()
		{
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SKYCITY_WAITING;
			string @string;
			if (flag)
			{
				@string = XStringDefineProxy.GetString("SKY_ARENA_LEAVE_TEAM_TIP");
			}
			else
			{
				@string = XStringDefineProxy.GetString("TEAM_SHOULD_LEAVE_TEAM_CONFIRM");
			}
			XSingleton<UiUtility>.singleton.ShowModalDialog(@string, XStringDefineProxy.GetString(XStringDefine.COMMON_OK), XStringDefineProxy.GetString(XStringDefine.COMMON_CANCEL), new ButtonClickEventHandler(XTeamDocument._LeaveAndEnter));
			return true;
		}

		// Token: 0x06009C92 RID: 40082 RVA: 0x00195530 File Offset: 0x00193730
		private static bool _Enter(IXUIButton button)
		{
			XTeamDocument._bCanEnter = true;
			bool flag = XTeamDocument._EnterHandler != null;
			if (flag)
			{
				XTeamDocument._EnterHandler(XTeamDocument._EnterButton);
				XTeamDocument._EnterHandler = null;
			}
			bool flag2 = XTeamDocument._EventDel != null;
			if (flag2)
			{
				XTeamDocument._EventDel();
				XTeamDocument._EventDel = null;
			}
			XSingleton<UiUtility>.singleton.CloseModalDlg();
			return true;
		}

		// Token: 0x06009C93 RID: 40083 RVA: 0x00195598 File Offset: 0x00193798
		private static bool _LeaveAndEnter(IXUIButton button)
		{
			XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			bool bInTeam = specificDocument.bInTeam;
			if (bInTeam)
			{
				specificDocument.ReqTeamOp(TeamOperate.TEAM_LEAVE, 0UL, null, TeamMemberType.TMT_NORMAL, null);
			}
			XTeamDocument._bCanEnter = true;
			bool flag = XTeamDocument._EnterHandler != null;
			if (flag)
			{
				XTeamDocument._EnterHandler(XTeamDocument._EnterButton);
				XTeamDocument._EnterHandler = null;
			}
			bool flag2 = XTeamDocument._EventDel != null;
			if (flag2)
			{
				XTeamDocument._EventDel();
				XTeamDocument._EventDel = null;
			}
			XSingleton<UiUtility>.singleton.CloseModalDlg();
			return true;
		}

		// Token: 0x06009C94 RID: 40084 RVA: 0x00195624 File Offset: 0x00193824
		public static void OnTeamHyperLinkClick(string param)
		{
			bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage != EXStage.Hall;
			if (!flag)
			{
				XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
				bool bInTeam = specificDocument.bInTeam;
				if (bInTeam)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(ErrorCode.ERR_TEAM_ALREADY_INTEAM, "fece00");
				}
				else
				{
					int teamID = 0;
					uint num = 0U;
					bool flag2 = !XLabelSymbolHelper.ParseTeamParam(param, ref teamID, ref num);
					if (!flag2)
					{
						XExpeditionDocument specificDocument2 = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
						ExpeditionTable.RowData expeditionDataByID = specificDocument2.GetExpeditionDataByID((int)num);
						bool flag3 = expeditionDataByID == null;
						if (flag3)
						{
							XSingleton<XDebug>.singleton.AddErrorLog("Invalid expedi ID ", num.ToString(), null, null, null, null);
						}
						else
						{
							bool flag4 = (long)expeditionDataByID.RequiredLevel > (long)((ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level);
							if (flag4)
							{
								XSingleton<UiUtility>.singleton.ShowSystemTip(ErrorCode.ERR_TEAM_LEVEL_REQUARE, "fece00");
							}
							else
							{
								XTeamDocument.bFromHyperLink = true;
								RpcC2M_TeamRequestC2M rpcC2M_TeamRequestC2M = new RpcC2M_TeamRequestC2M();
								rpcC2M_TeamRequestC2M.oArg.expID = num;
								rpcC2M_TeamRequestC2M.oArg.teamID = teamID;
								rpcC2M_TeamRequestC2M.oArg.request = TeamOperate.TEAM_JOIN;
								XSingleton<XClientNetwork>.singleton.Send(rpcC2M_TeamRequestC2M);
								specificDocument._SetCurrentTeamInfo(expeditionDataByID);
							}
						}
					}
				}
			}
		}

		// Token: 0x040036C3 RID: 14019
		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("TeamDocument");

		// Token: 0x040036C4 RID: 14020
		public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();

		// Token: 0x040036C5 RID: 14021
		private static PveProfessionTable m_pveProfessionTables = new PveProfessionTable();

		// Token: 0x040036C6 RID: 14022
		private static Dictionary<string, PveProfessionTable.RowData> m_pveProfessions = new Dictionary<string, PveProfessionTable.RowData>();

		// Token: 0x040036C7 RID: 14023
		public XTeamListHandler TeamListView;

		// Token: 0x040036C8 RID: 14024
		public XMyTeamHandler MyTeamView;

		// Token: 0x040036C9 RID: 14025
		private List<XTeamBriefData> _TeamList = new List<XTeamBriefData>();

		// Token: 0x040036CA RID: 14026
		public XTeamListView AllListView;

		// Token: 0x040036CB RID: 14027
		public XTeamDungeonSelectorHandler DungeonSelector;

		// Token: 0x040036CC RID: 14028
		public ExpeditionTable.RowData currentExpInfo;

		// Token: 0x040036CD RID: 14029
		public uint currentDungeonID;

		// Token: 0x040036CE RID: 14030
		public string currentCategoryName;

		// Token: 0x040036CF RID: 14031
		public string currentDungeonName;

		// Token: 0x040036D0 RID: 14032
		public TeamLevelType currentDungeonType = TeamLevelType.TeamLevelNone;

		// Token: 0x040036D1 RID: 14033
		public string teamLeagueName;

		// Token: 0x040036D2 RID: 14034
		private XExpeditionDocument m_ExpDoc = null;

		// Token: 0x040036D3 RID: 14035
		public SceneTable.RowData currentSceneData;

		// Token: 0x040036D4 RID: 14036
		public string password = "";

		// Token: 0x040036D5 RID: 14037
		private bool _bVoting;

		// Token: 0x040036D6 RID: 14038
		private bool m_bAutoMatching = false;

		// Token: 0x040036D7 RID: 14039
		private KMatchType m_SoloMatchType = KMatchType.KMT_NONE;

		// Token: 0x040036D8 RID: 14040
		private XTeam _MyTeam;

		// Token: 0x040036D9 RID: 14041
		private bool bTryAutoJoin = false;

		// Token: 0x040036DA RID: 14042
		private static bool bFromHyperLink = false;

		// Token: 0x040036DB RID: 14043
		private float m_fMatchingTime = -1f;

		// Token: 0x040036DC RID: 14044
		private int m_nMatchingTime = -1;

		// Token: 0x040036DD RID: 14045
		private int m_AutoSelectFloatingLevel = -10;

		// Token: 0x040036DE RID: 14046
		private int m_TeamListSortDirection = 1;

		// Token: 0x040036DF RID: 14047
		private TeamBriefSortType m_TeamListSortType = TeamBriefSortType.TBST_MEMBER_COUNT;

		// Token: 0x040036E0 RID: 14048
		private HashSet<int> m_TeamListSelectedCategories = new HashSet<int>();

		// Token: 0x040036E1 RID: 14049
		private uint _tarja = 0U;

		// Token: 0x040036E2 RID: 14050
		private bool m_bReqTeamListJustTarget;

		// Token: 0x040036E3 RID: 14051
		private static ButtonClickEventHandler _EnterHandler = null;

		// Token: 0x040036E4 RID: 14052
		private static IXUIButton _EnterButton = null;

		// Token: 0x040036E5 RID: 14053
		private static bool _bCanEnter = false;

		// Token: 0x040036E6 RID: 14054
		private static EventDelegate _EventDel;

		// Token: 0x02001988 RID: 6536
		private struct XPreviousTeamData
		{
			// Token: 0x06011014 RID: 69652 RVA: 0x00453417 File Offset: 0x00451617
			public XPreviousTeamData(XTeamDocument _doc)
			{
				this.doc = _doc;
				this.state = TeamState.TEAM_WAITING;
				this.goldGroupIndex = -1;
				this.goldGroupItemID = 0;
				this.bNewTeam = false;
				this.leaderName = null;
				this.expData = null;
			}

			// Token: 0x06011015 RID: 69653 RVA: 0x0045344C File Offset: 0x0045164C
			public void PreserveTeamData(XTeam team)
			{
				this.state = team.teamBrief.actualState;
				this.goldGroupIndex = team.teamBrief.goldGroup.index;
				this.goldGroupItemID = team.teamBrief.goldGroup.itemid;
				this.leaderName = team.teamBrief.leaderName;
				this.expData = team.teamBrief.rowData;
			}

			// Token: 0x06011016 RID: 69654 RVA: 0x004534BC File Offset: 0x004516BC
			public void CheckNewTeamData(XTeam team)
			{
				bool flag = this.state != team.teamBrief.actualState;
				if (flag)
				{
					this.doc.ToggleVoting(team.teamBrief.actualState == TeamState.TEAM_VOTE);
				}
				bool flag2 = !this.bNewTeam && this.goldGroupIndex != team.teamBrief.goldGroup.index;
				if (flag2)
				{
					int index = team.teamBrief.goldGroup.index;
					bool flag3 = this.doc.currentExpInfo != null;
					if (flag3)
					{
						bool flag4 = index < 0;
						if (flag4)
						{
							bool flag5 = this.doc.MyTeam.myData.name == this.leaderName;
							if (!flag5)
							{
								XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TeamGoldGroupTurnedOff"), "fece00");
							}
						}
						else
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("TeamGoldGroupTurnedOn", new object[]
							{
								XGoldGroupData.GetName(ref this.doc.currentExpInfo.CostType, index)
							}), "fece00");
						}
					}
				}
			}

			// Token: 0x04007ED8 RID: 32472
			public TeamState state;

			// Token: 0x04007ED9 RID: 32473
			public int goldGroupIndex;

			// Token: 0x04007EDA RID: 32474
			public int goldGroupItemID;

			// Token: 0x04007EDB RID: 32475
			public bool bNewTeam;

			// Token: 0x04007EDC RID: 32476
			public string leaderName;

			// Token: 0x04007EDD RID: 32477
			public ExpeditionTable.RowData expData;

			// Token: 0x04007EDE RID: 32478
			private XTeamDocument doc;
		}
	}
}
